<?php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{

    protected function _initAutoload() {
        $autoloader = new Zend_Application_Module_Autoloader(array(
                    'namespace' => 'Application',
                    'basePath' => APPLICATION_PATH,
                ));

        $autoloader->addResourceType('model', 'models', 'Model');
        return $autoloader;
    }

    protected function _initFrontController() {
        $front = Zend_Controller_Front::getInstance();
        $front->addControllerDirectory(APPLICATION_PATH . "/controllers");

// 	   	$config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/routers.ini', 'thietlap');
        $router = new Zend_Controller_Router_Rewrite();

// 	   	$router = $router->addConfig($config, 'routes');

//         $front->setRouter($router);
        $r = $front->getRouter();
		
        $route = new Zend_Controller_Router_Route('bai-tap/cau-2.html',
                        array('controller' => 'index', 'action' => 'cau2'));
        
        $r->addRoute('sd', $route);

//         $route = new Zend_Controller_Router_Route_Regex('index/detail/(\d+)-?(.*).html',
//                         array('controller' => 'index', 'action' => 'detail'),
//                         array(1 => 'id', 2 => 'title'));
//         $r->addRoute('sd', $route);

        return $front;
    }

}

